In [1]:
import musicntd.scripts.hide_code as hide
C:\Users\amarmore\AppData\Local\Continuum\anaconda3\envs\NTD_segmentation\lib\site-packages\librosa\util\decorators.py:9: NumbaDeprecationWarning: An import was requested from a module that has moved location.
Import requested from: 'numba.decorators', please update to use 'numba.core.decorators' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.
  from numba.decorators import jit as optional_jit
C:\Users\amarmore\AppData\Local\Continuum\anaconda3\envs\NTD_segmentation\lib\site-packages\librosa\util\decorators.py:9: NumbaDeprecationWarning: An import was requested from a module that has moved location.
Import of 'jit' requested from: 'numba.decorators', please update to use 'numba.core.decorators' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.
  from numba.decorators import jit as optional_jit

This notebook aims at studying 3 different kernels for the convolution measure.

Note, as a prerequisite, that the diagonal of all our kernels is zero. Indeed, we consider that the diagonal of autosimilarity matrices doesn't hold structural information, and that considering it is counter-productive.

More details about the design of these kernels can be found in the Notebook "Appendix - Focus on the segmentation algorithm".

Full kernel

This kernel is a square matrix only composed of 0 and 1. It is equal to 0 on the diagonal, and to 1 elsewhere.

It looks like:

(or, in a matrix form: $\left[ \begin{matrix} 0 & 1 & 1 & 1& 1 & 1 & 1 & 1\\ 1 & 0 & 1 & 1& 1 & 1 & 1 & 1\\ 1 & 1 & 0 & 1& 1 & 1 & 1 & 1\\ 1 & 1 & 1 & 0 & 1 & 1 & 1 & 1\\ 1 & 1 & 1 & 1 & 0 & 1 & 1 & 1\\ 1 & 1 & 1 & 1 & 1 & 0 & 1 & 1\\ 1 & 1 & 1& 1 & 1 & 1 & 0 & 1\\ 1 & 1 & 1& 1 & 1 & 1 & 1 & 0\\ \end{matrix} \right]$ (of size 8 here)).

Mathematically, for a segment ($b_1, b_2$), the associated cost will be $c_{b_1,b_2} = \frac{1}{b_2 - b_1 + 1}\sum_{i,j = 0, i \ne j}^{n - 1} a_{i + b_1, j + b_1}$.

By construction, this kernel catches the similarity everywhere around the diagonal. As high similarity means higher values (and dark zones) in our autosimilarities, the higher this kernel, the more similar is the zone we are studying.

(You should read the "Appendix - Focus on the segmentation algorithm" notebook if you don't understand well how our algorithm work, and why the kernel is important).

Fixed ranks

Below are segmentation results with different ranks values, but each time fixed over the entire RWC Pop dataset.

Results are computed with tolerance of respectively 0.5 seconds and 3 seconds.

In [2]:
annotations_type = "MIREX10"
ranks_rhythm = [12,16,20,24,28,32,36,40,44,48]
ranks_pattern = [12,16,20,24,28,32,36,40,44,48]
zero_five_full, three_full = hide.compute_ranks_RWC(ranks_rhythm,ranks_pattern, W = "chromas", annotations_type = annotations_type,
                                                  subdivision=96, penalty_weight = 1,penalty_func = "modulo8", convolution_type = "full")
0.5 seconds results True Positives False Positives False Negatives Precision Recall F measure
Rang Q:12 Rang H:12 7.5400 5.5000 11.2700 0.5806 0.4113 0.4726
Rang H:16 7.8500 5.4200 10.9600 0.5933 0.4270 0.4881
Rang H:20 7.9500 5.3900 10.8600 0.6017 0.4320 0.4941
Rang H:24 8.0000 5.3100 10.8100 0.6029 0.4333 0.4958
Rang H:28 8.0500 5.3800 10.7600 0.6024 0.4354 0.4970
Rang H:32 7.8000 5.7300 11.0100 0.5764 0.4228 0.4788
Rang H:36 8.1800 5.1200 10.6300 0.6118 0.4411 0.5045
Rang H:40 8.1400 5.4600 10.6700 0.5999 0.4400 0.4994
Rang H:44 8.2200 5.3500 10.5900 0.6041 0.4456 0.5046
Rang H:48 8.1600 5.3000 10.6500 0.6052 0.4395 0.5010
Rang Q:16 Rang H:12 8.3200 5.8100 10.4900 0.5895 0.4526 0.5026
Rang H:16 8.7500 5.5600 10.0600 0.6151 0.4719 0.5256
Rang H:20 9.1500 5.3700 9.6600 0.6296 0.4944 0.5451
Rang H:24 9.1200 5.2700 9.6900 0.6347 0.4933 0.5477
Rang H:28 9.0000 5.4600 9.8100 0.6266 0.4879 0.5403
Rang H:32 8.8200 5.8400 9.9900 0.6086 0.4775 0.5274
Rang H:36 9.1000 5.5800 9.7100 0.6216 0.4901 0.5407
Rang H:40 9.2200 5.4300 9.5900 0.6341 0.4979 0.5500
Rang H:44 9.2400 5.2400 9.5700 0.6396 0.4987 0.5533
Rang H:48 9.1800 5.4900 9.6300 0.6264 0.4954 0.5459
Rang Q:20 Rang H:12 9.1000 5.5600 9.7100 0.6246 0.4916 0.5419
Rang H:16 9.3100 5.5300 9.5000 0.6257 0.5020 0.5483
Rang H:20 9.5000 5.7600 9.3100 0.6258 0.5110 0.5541
Rang H:24 9.6500 5.5100 9.1600 0.6362 0.5192 0.5642
Rang H:28 9.7000 5.6100 9.1100 0.6354 0.5228 0.5656
Rang H:32 9.4300 5.9500 9.3800 0.6201 0.5082 0.5503
Rang H:36 9.6000 5.6400 9.2100 0.6294 0.5185 0.5609
Rang H:40 9.8200 5.3600 8.9900 0.6533 0.5297 0.5764
Rang H:44 9.5000 5.7400 9.3100 0.6248 0.5128 0.5547
Rang H:48 9.7200 5.4600 9.0900 0.6413 0.5221 0.5677
Rang Q:24 Rang H:12 9.2800 5.8700 9.5300 0.6203 0.5028 0.5473
Rang H:16 9.3200 5.6800 9.4900 0.6229 0.5042 0.5499
Rang H:20 9.6400 5.7800 9.1700 0.6267 0.5226 0.5627
Rang H:24 9.9500 5.7400 8.8600 0.6412 0.5365 0.5761
Rang H:28 9.8800 5.9400 8.9300 0.6252 0.5319 0.5671
Rang H:32 9.8100 6.0900 9.0000 0.6219 0.5300 0.5655
Rang H:36 10.0900 5.7200 8.7200 0.6415 0.5432 0.5812
Rang H:40 9.8600 6.0000 8.9500 0.6253 0.5326 0.5685
Rang H:44 9.9500 5.9400 8.8600 0.6264 0.5356 0.5712
Rang H:48 9.9000 5.7600 8.9100 0.6377 0.5329 0.5743
Rang Q:28 Rang H:12 9.4700 5.9200 9.3400 0.6160 0.5116 0.5507
Rang H:16 9.7100 6.1500 9.1000 0.6137 0.5225 0.5567
Rang H:20 9.8400 5.9600 8.9700 0.6206 0.5292 0.5643
Rang H:24 9.8700 6.1300 8.9400 0.6181 0.5318 0.5652
Rang H:28 10.2800 5.8500 8.5300 0.6381 0.5517 0.5846
Rang H:32 9.7400 6.4900 9.0700 0.6013 0.5252 0.5540
Rang H:36 10.2600 5.7400 8.5500 0.6399 0.5536 0.5861
Rang H:40 10.0100 5.9200 8.8000 0.6275 0.5374 0.5722
Rang H:44 10.0300 6.0100 8.7800 0.6251 0.5410 0.5729
Rang H:48 10.0100 6.3300 8.8000 0.6089 0.5413 0.5672
Rang Q:32 Rang H:12 9.6000 6.1500 9.2100 0.6104 0.5196 0.5530
Rang H:16 9.9200 6.4400 8.8900 0.6128 0.5343 0.5640
Rang H:20 9.9000 6.2200 8.9100 0.6112 0.5330 0.5634
Rang H:24 9.9500 6.7200 8.8600 0.5970 0.5320 0.5554
Rang H:28 9.8100 6.6600 9.0000 0.5956 0.5263 0.5523
Rang H:32 10.3900 5.8100 8.4200 0.6421 0.5603 0.5922
Rang H:36 10.3000 6.0000 8.5100 0.6341 0.5557 0.5836
Rang H:40 10.1200 6.0500 8.6900 0.6271 0.5427 0.5749
Rang H:44 10.0600 6.1900 8.7500 0.6158 0.5403 0.5688
Rang H:48 10.2900 5.9900 8.5200 0.6320 0.5540 0.5840
Rang Q:36 Rang H:12 9.6500 6.0100 9.1600 0.6152 0.5203 0.5563
Rang H:16 9.9900 5.9500 8.8200 0.6236 0.5380 0.5704
Rang H:20 10.0900 6.2400 8.7200 0.6149 0.5430 0.5706
Rang H:24 10.3900 6.1200 8.4200 0.6286 0.5563 0.5832
Rang H:28 9.8400 6.4400 8.9700 0.6013 0.5313 0.5576
Rang H:32 9.9300 6.5600 8.8800 0.5982 0.5313 0.5564
Rang H:36 10.2600 6.4300 8.5500 0.6135 0.5523 0.5748
Rang H:40 10.5400 6.1400 8.2700 0.6296 0.5655 0.5891
Rang H:44 10.1200 6.3100 8.6900 0.6135 0.5404 0.5679
Rang H:48 10.2600 6.2300 8.5500 0.6212 0.5527 0.5783
Rang Q:40 Rang H:12 9.5900 6.0300 9.2200 0.6104 0.5199 0.5546
Rang H:16 9.5600 6.5400 9.2500 0.5932 0.5137 0.5426
Rang H:20 10.1100 6.4100 8.7000 0.6077 0.5430 0.5662
Rang H:24 9.9800 6.4600 8.8300 0.6054 0.5332 0.5600
Rang H:28 9.9900 6.5600 8.8200 0.6010 0.5347 0.5587
Rang H:32 10.0000 6.6700 8.8100 0.6010 0.5370 0.5604
Rang H:36 10.1300 6.5600 8.6800 0.6080 0.5422 0.5664
Rang H:40 10.2800 6.3400 8.5300 0.6212 0.5513 0.5773
Rang H:44 10.1400 6.4000 8.6700 0.6150 0.5462 0.5710
Rang H:48 9.9300 6.5100 8.8800 0.6049 0.5340 0.5600
Rang Q:44 Rang H:12 9.8900 6.1300 8.9200 0.6169 0.5324 0.5634
Rang H:16 10.1800 6.4000 8.6300 0.6146 0.5461 0.5700
Rang H:20 10.1700 6.3200 8.6400 0.6169 0.5444 0.5721
Rang H:24 10.3500 6.1200 8.4600 0.6294 0.5528 0.5823
Rang H:28 9.9800 6.7700 8.8300 0.5929 0.5333 0.5547
Rang H:32 10.3200 6.1600 8.4900 0.6251 0.5522 0.5792
Rang H:36 10.0700 6.6300 8.7400 0.6042 0.5411 0.5633
Rang H:40 10.1600 6.6100 8.6500 0.6071 0.5418 0.5655
Rang H:44 9.9200 6.8400 8.8900 0.5939 0.5309 0.5534
Rang H:48 9.8500 6.8300 8.9600 0.5943 0.5299 0.5526
Rang Q:48 Rang H:12 10.0200 6.1400 8.7900 0.6150 0.5404 0.5683
Rang H:16 9.8700 6.4600 8.9400 0.6021 0.5299 0.5561
Rang H:20 9.7000 6.6700 9.1100 0.5925 0.5202 0.5470
Rang H:24 9.8600 6.7000 8.9500 0.5950 0.5281 0.5523
Rang H:28 10.0000 6.5600 8.8100 0.6015 0.5334 0.5592
Rang H:32 10.1400 6.6100 8.6700 0.6039 0.5411 0.5641
Rang H:36 9.3900 7.2300 9.4200 0.5643 0.5053 0.5259
Rang H:40 9.8700 6.9500 8.9400 0.5863 0.5290 0.5500
Rang H:44 9.8300 6.7700 8.9800 0.5925 0.5271 0.5506
Rang H:48 9.6700 7.1000 9.1400 0.5761 0.5151 0.5374
3 seconds results True Positives False Positives False Negatives Precision Recall F measure
Rang Q:12 Rang H:12 10.0300 3.0100 8.7800 0.7840 0.5425 0.6296
Rang H:16 10.1600 3.1100 8.6500 0.7796 0.5506 0.6341
Rang H:20 10.1900 3.1500 8.6200 0.7809 0.5523 0.6356
Rang H:24 10.2000 3.1100 8.6100 0.7781 0.5510 0.6344
Rang H:28 10.2800 3.1500 8.5300 0.7792 0.5554 0.6378
Rang H:32 10.2800 3.2500 8.5300 0.7750 0.5554 0.6355
Rang H:36 10.2800 3.0200 8.5300 0.7814 0.5549 0.6387
Rang H:40 10.2900 3.3100 8.5200 0.7698 0.5567 0.6357
Rang H:44 10.4700 3.1000 8.3400 0.7838 0.5669 0.6470
Rang H:48 10.3600 3.1000 8.4500 0.7826 0.5596 0.6419
Rang Q:16 Rang H:12 10.8700 3.2600 7.9400 0.7837 0.5881 0.6598
Rang H:16 11.0700 3.2400 7.7400 0.7889 0.5961 0.6684
Rang H:20 11.3500 3.1700 7.4600 0.7968 0.6126 0.6813
Rang H:24 11.2400 3.1500 7.5700 0.7952 0.6075 0.6792
Rang H:28 11.2600 3.2000 7.5500 0.7908 0.6090 0.6774
Rang H:32 11.3600 3.3000 7.4500 0.7898 0.6110 0.6785
Rang H:36 11.3300 3.3500 7.4800 0.7847 0.6094 0.6764
Rang H:40 11.2800 3.3700 7.5300 0.7842 0.6073 0.6746
Rang H:44 11.2000 3.2800 7.6100 0.7850 0.6027 0.6728
Rang H:48 11.4100 3.2600 7.4000 0.7890 0.6146 0.6814
Rang Q:20 Rang H:12 11.2400 3.4200 7.5700 0.7815 0.6051 0.6713
Rang H:16 11.6200 3.2200 7.1900 0.7979 0.6272 0.6911
Rang H:20 11.6600 3.6000 7.1500 0.7806 0.6272 0.6848
Rang H:24 11.7100 3.4500 7.1000 0.7850 0.6305 0.6896
Rang H:28 11.9000 3.4100 6.9100 0.7902 0.6418 0.6981
Rang H:32 11.6700 3.7100 7.1400 0.7712 0.6273 0.6815
Rang H:36 11.7900 3.4500 7.0200 0.7855 0.6354 0.6923
Rang H:40 11.8100 3.3700 7.0000 0.7917 0.6358 0.6945
Rang H:44 11.6200 3.6200 7.1900 0.7738 0.6267 0.6817
Rang H:48 11.7800 3.4000 7.0300 0.7894 0.6333 0.6927
Rang Q:24 Rang H:12 11.5500 3.6000 7.2600 0.7756 0.6227 0.6803
Rang H:16 11.5800 3.4200 7.2300 0.7823 0.6253 0.6854
Rang H:20 11.7900 3.6300 7.0200 0.7750 0.6354 0.6887
Rang H:24 12.0100 3.6800 6.8000 0.7801 0.6457 0.6963
Rang H:28 12.0900 3.7300 6.7200 0.7730 0.6496 0.6961
Rang H:32 12.1800 3.7200 6.6300 0.7765 0.6551 0.7018
Rang H:36 12.0000 3.8100 6.8100 0.7727 0.6459 0.6944
Rang H:40 11.9900 3.8700 6.8200 0.7668 0.6457 0.6925
Rang H:44 12.2700 3.6200 6.5400 0.7790 0.6583 0.7056
Rang H:48 12.0100 3.6500 6.8000 0.7746 0.6453 0.6964
Rang Q:28 Rang H:12 11.7300 3.6600 7.0800 0.7717 0.6318 0.6841
Rang H:16 12.0000 3.8600 6.8100 0.7695 0.6463 0.6920
Rang H:20 12.0300 3.7700 6.7800 0.7678 0.6466 0.6929
Rang H:24 12.2700 3.7300 6.5400 0.7758 0.6588 0.7039
Rang H:28 12.2400 3.8900 6.5700 0.7679 0.6576 0.6996
Rang H:32 12.2000 4.0300 6.6100 0.7581 0.6554 0.6944
Rang H:36 12.1500 3.8500 6.6600 0.7626 0.6554 0.6958
Rang H:40 12.1700 3.7600 6.6400 0.7703 0.6540 0.6990
Rang H:44 12.1500 3.8900 6.6600 0.7629 0.6532 0.6947
Rang H:48 12.4000 3.9400 6.4100 0.7657 0.6672 0.7046
Rang Q:32 Rang H:12 11.9200 3.8300 6.8900 0.7624 0.6409 0.6857
Rang H:16 12.2900 4.0700 6.5200 0.7588 0.6591 0.6967
Rang H:20 12.1900 3.9300 6.6200 0.7604 0.6551 0.6954
Rang H:24 12.3900 4.2800 6.4200 0.7525 0.6645 0.6963
Rang H:28 12.3200 4.1500 6.4900 0.7550 0.6607 0.6960
Rang H:32 12.4000 3.8000 6.4100 0.7699 0.6666 0.7067
Rang H:36 12.3700 3.9300 6.4400 0.7675 0.6656 0.7023
Rang H:40 12.3700 3.8000 6.4400 0.7728 0.6652 0.7065
Rang H:44 12.3100 3.9400 6.5000 0.7615 0.6626 0.7001
Rang H:48 12.5900 3.6900 6.2200 0.7794 0.6758 0.7158
Rang Q:36 Rang H:12 11.8400 3.8200 6.9700 0.7617 0.6383 0.6846
Rang H:16 12.1200 3.8200 6.6900 0.7624 0.6521 0.6935
Rang H:20 12.2200 4.1100 6.5900 0.7527 0.6556 0.6922
Rang H:24 12.4500 4.0600 6.3600 0.7607 0.6680 0.7027
Rang H:28 12.2000 4.0800 6.6100 0.7540 0.6556 0.6921
Rang H:32 12.4700 4.0200 6.3400 0.7612 0.6666 0.7023
Rang H:36 12.4600 4.2300 6.3500 0.7521 0.6701 0.7006
Rang H:40 12.6100 4.0700 6.2000 0.7613 0.6762 0.7076
Rang H:44 12.3900 4.0400 6.4200 0.7593 0.6646 0.7004
Rang H:48 12.4100 4.0800 6.4000 0.7562 0.6675 0.7005
Rang Q:40 Rang H:12 11.9100 3.7100 6.9000 0.7695 0.6424 0.6906
Rang H:16 12.0700 4.0300 6.7400 0.7560 0.6481 0.6874
Rang H:20 12.3800 4.1400 6.4300 0.7524 0.6653 0.6966
Rang H:24 12.4000 4.0400 6.4100 0.7615 0.6643 0.7003
Rang H:28 12.4100 4.1400 6.4000 0.7535 0.6642 0.6968
Rang H:32 12.3300 4.3400 6.4800 0.7477 0.6613 0.6929
Rang H:36 12.3200 4.3700 6.4900 0.7455 0.6609 0.6923
Rang H:40 12.5700 4.0500 6.2400 0.7640 0.6744 0.7078
Rang H:44 12.2500 4.2900 6.5600 0.7496 0.6595 0.6917
Rang H:48 12.3500 4.0900 6.4600 0.7629 0.6641 0.7007
Rang Q:44 Rang H:12 12.2700 3.7500 6.5400 0.7779 0.6607 0.7039
Rang H:16 12.3500 4.2300 6.4600 0.7528 0.6638 0.6947
Rang H:20 12.4100 4.0800 6.4000 0.7581 0.6660 0.7013
Rang H:24 12.4400 4.0300 6.3700 0.7588 0.6659 0.7017
Rang H:28 12.4200 4.3300 6.3900 0.7490 0.6662 0.6964
Rang H:32 12.5000 3.9800 6.3100 0.7616 0.6711 0.7050
Rang H:36 12.4700 4.2300 6.3400 0.7535 0.6699 0.6996
Rang H:40 12.4100 4.3600 6.4000 0.7487 0.6635 0.6947
Rang H:44 12.3700 4.3900 6.4400 0.7455 0.6631 0.6926
Rang H:48 12.3500 4.3300 6.4600 0.7481 0.6628 0.6935
Rang Q:48 Rang H:12 12.2400 3.9200 6.5700 0.7651 0.6577 0.6976
Rang H:16 12.3000 4.0300 6.5100 0.7610 0.6612 0.6971
Rang H:20 12.1800 4.1900 6.6300 0.7508 0.6541 0.6900
Rang H:24 12.2500 4.3100 6.5600 0.7435 0.6548 0.6869
Rang H:28 12.2500 4.3100 6.5600 0.7403 0.6559 0.6878
Rang H:32 12.3500 4.4000 6.4600 0.7401 0.6614 0.6901
Rang H:36 12.1700 4.4500 6.6400 0.7407 0.6531 0.6839
Rang H:40 12.2900 4.5300 6.5200 0.7350 0.6579 0.6866
Rang H:44 12.1500 4.4500 6.6600 0.7381 0.6516 0.6830
Rang H:48 12.3200 4.4500 6.4900 0.7410 0.6601 0.6895

Oracle ranks

In this condition, we only keep the ranks leading to the highest F measure.

In that sense, it's an optimistic upper bound on metrics.

In [3]:
hide.printmd("**A 0.5 secondes:**")
best_chr_zero_five = hide.best_f_one_score_rank(zero_five_full)
hide.printmd("**A 3 secondes:**")
best_chr_three = hide.best_f_one_score_rank(three_full)

A 0.5 secondes:

True Positives False Positives False Negatives Precision Recall F measure
Maximizing the f measure on each song: 12.51 3.75 6.3 0.7719 0.6721 0.7116

A 3 secondes:

True Positives False Positives False Negatives Precision Recall F measure
Maximizing the f measure on each song: 14.3 2.09 4.51 0.8783 0.7696 0.8143

Below is presented the distribution of the optimal ranks in the "oracle ranks" condition, i.e. the distribution of the ranks for $H$ and $Q$ which result in the highest F measure for the different songs.

In [4]:
hide.plot_3d_ranks_study(zero_five_full, ranks_rhythm, ranks_pattern)

Below is shown the distribution histogram of the F measure obtained with the oracle ranks.

In [5]:
hide.plot_f_mes_histogram(zero_five_full)

8 bands kernel

This kernel focuses on local similarities in the 8 bars surrounding each bar of the diagonal (4 bars in the future, 4 bars in the past). Concretely, this kernel is a matrix where the only non-zero elements are the 8 closest bands parallel to the diagonal.

It looks like:

(or, in a matrix form: $\left[ \begin{matrix} 0 & 1 & 1 & 1& 1 & 0 & 0 & 0\\ 1 & 0 & 1 & 1& 1 & 1 & 0 & 0\\ 1 & 1 & 0 & 1& 1 & 1 & 1 & 0\\ 1 & 1 & 1 & 0 & 1 & 1 & 1 & 1\\ 1 & 1 & 1 & 1 & 0 & 1 & 1 & 1\\ 0 & 1 & 1 & 1 & 1 & 0 & 1 & 1\\ 0 & 0 & 1& 1 & 1 & 1 & 0 & 1\\ 0 & 0 & 0& 1 & 1 & 1 & 1 & 0\\ \end{matrix} \right]$ (of size 8 here)).

Mathematically, for a segment ($b_1, b_2$), the associated cost will be $c_{b_1,b_2} = \frac{1}{b_2 - b_1 + 1}\sum_{i,j = 0, 1 \leq |i - j| \leq 4}^{n - 1} a_{i + b_1, j + b_1}$.

Fixed ranks

Below are segmentation results with different ranks values, but each time fixed over the entire RWC Pop dataset.

Results are computed with tolerance of respectively 0.5 seconds and 3 seconds.

In [6]:
annotations_type = "MIREX10"
ranks_rhythm = [12,16,20,24,28,32,36,40,44,48]
ranks_pattern = [12,16,20,24,28,32,36,40,44,48]
zero_five_eight, three_eight = hide.compute_ranks_RWC(ranks_rhythm,ranks_pattern, W = "chromas", annotations_type = annotations_type,
                                                  subdivision=96, penalty_weight = 1,penalty_func = "modulo8", convolution_type = "eight_bands")
0.5 seconds results True Positives False Positives False Negatives Precision Recall F measure
Rang Q:12 Rang H:12 10.3000 13.3900 8.5100 0.4498 0.5533 0.4900
Rang H:16 10.8100 12.7400 8.0000 0.4753 0.5809 0.5163
Rang H:20 11.3800 11.9200 7.4300 0.5059 0.6083 0.5455
Rang H:24 11.0700 12.4400 7.7400 0.4865 0.5916 0.5271
Rang H:28 11.1300 12.2200 7.6800 0.4919 0.5950 0.5315
Rang H:32 10.6900 12.9300 8.1200 0.4684 0.5719 0.5083
Rang H:36 11.1700 12.2500 7.6400 0.4945 0.5969 0.5340
Rang H:40 11.3700 12.2500 7.4400 0.5002 0.6074 0.5416
Rang H:44 11.3100 12.2500 7.5000 0.4972 0.6036 0.5382
Rang H:48 11.1200 12.3300 7.6900 0.4888 0.5936 0.5294
Rang Q:16 Rang H:12 10.9900 12.7400 7.8200 0.4816 0.5930 0.5244
Rang H:16 11.5700 11.7400 7.2400 0.5172 0.6173 0.5560
Rang H:20 11.7900 11.7900 7.0200 0.5234 0.6325 0.5655
Rang H:24 11.5100 12.0200 7.3000 0.5098 0.6211 0.5526
Rang H:28 11.7200 11.7900 7.0900 0.5189 0.6268 0.5605
Rang H:32 11.1700 12.4300 7.6400 0.4953 0.6009 0.5363
Rang H:36 11.4100 12.0700 7.4000 0.5055 0.6091 0.5451
Rang H:40 11.6300 11.9200 7.1800 0.5130 0.6238 0.5559
Rang H:44 11.7200 11.8000 7.0900 0.5193 0.6263 0.5608
Rang H:48 11.5800 11.7600 7.2300 0.5169 0.6190 0.5561
Rang Q:20 Rang H:12 11.7700 11.9600 7.0400 0.5160 0.6306 0.5605
Rang H:16 11.7700 11.7400 7.0400 0.5194 0.6266 0.5610
Rang H:20 12.0000 11.3600 6.8100 0.5355 0.6406 0.5762
Rang H:24 12.0600 11.4000 6.7500 0.5366 0.6447 0.5783
Rang H:28 11.9300 11.3800 6.8800 0.5338 0.6399 0.5753
Rang H:32 11.7800 11.7200 7.0300 0.5272 0.6341 0.5690
Rang H:36 11.9300 11.3800 6.8800 0.5365 0.6408 0.5775
Rang H:40 12.1200 11.1500 6.6900 0.5441 0.6506 0.5855
Rang H:44 11.5900 11.8700 7.2200 0.5195 0.6234 0.5592
Rang H:48 11.8400 11.5800 6.9700 0.5296 0.6333 0.5697
Rang Q:24 Rang H:12 11.7200 11.8100 7.0900 0.5213 0.6280 0.5632
Rang H:16 11.8300 11.3900 6.9800 0.5321 0.6334 0.5713
Rang H:20 11.8800 11.6200 6.9300 0.5287 0.6385 0.5715
Rang H:24 11.9900 11.3200 6.8200 0.5368 0.6416 0.5773
Rang H:28 12.1700 11.2000 6.6400 0.5445 0.6510 0.5858
Rang H:32 11.8800 11.5600 6.9300 0.5325 0.6391 0.5746
Rang H:36 12.1300 11.0900 6.6800 0.5460 0.6491 0.5862
Rang H:40 11.9500 11.3500 6.8600 0.5337 0.6392 0.5750
Rang H:44 12.1100 11.0600 6.7000 0.5434 0.6467 0.5836
Rang H:48 12.2200 10.9500 6.5900 0.5539 0.6535 0.5920
Rang Q:28 Rang H:12 11.8400 11.4100 6.9700 0.5331 0.6374 0.5736
Rang H:16 11.8400 11.6000 6.9700 0.5237 0.6299 0.5648
Rang H:20 11.8900 11.3000 6.9200 0.5317 0.6342 0.5714
Rang H:24 11.9500 11.1300 6.8600 0.5394 0.6384 0.5780
Rang H:28 12.0700 11.1300 6.7400 0.5430 0.6443 0.5821
Rang H:32 12.0000 11.3900 6.8100 0.5332 0.6425 0.5756
Rang H:36 12.4200 10.9000 6.3900 0.5564 0.6663 0.5990
Rang H:40 12.2200 10.8900 6.5900 0.5506 0.6526 0.5900
Rang H:44 11.8900 11.0300 6.9200 0.5370 0.6362 0.5762
Rang H:48 12.1400 11.2400 6.6700 0.5420 0.6497 0.5842
Rang Q:32 Rang H:12 11.6100 11.7300 7.2000 0.5210 0.6223 0.5606
Rang H:16 11.9700 11.3700 6.8400 0.5368 0.6435 0.5785
Rang H:20 11.7700 11.4300 7.0400 0.5318 0.6323 0.5708
Rang H:24 11.8300 11.7300 6.9800 0.5214 0.6329 0.5647
Rang H:28 12.1200 11.3700 6.6900 0.5347 0.6493 0.5796
Rang H:32 12.0600 11.0500 6.7500 0.5401 0.6471 0.5822
Rang H:36 11.8100 11.2900 7.0000 0.5337 0.6328 0.5715
Rang H:40 11.8500 11.2900 6.9600 0.5320 0.6336 0.5709
Rang H:44 11.6100 11.4500 7.2000 0.5213 0.6222 0.5601
Rang H:48 11.8400 11.0200 6.9700 0.5376 0.6347 0.5749
Rang Q:36 Rang H:12 11.9500 11.2500 6.8600 0.5375 0.6394 0.5767
Rang H:16 11.9300 10.8700 6.8800 0.5412 0.6392 0.5791
Rang H:20 11.9600 11.1100 6.8500 0.5364 0.6393 0.5763
Rang H:24 11.8400 11.2200 6.9700 0.5324 0.6320 0.5707
Rang H:28 11.8500 11.0600 6.9600 0.5343 0.6344 0.5736
Rang H:32 11.5400 11.5500 7.2700 0.5163 0.6144 0.5543
Rang H:36 12.0000 10.9500 6.8100 0.5445 0.6447 0.5833
Rang H:40 12.1700 10.9400 6.6400 0.5457 0.6509 0.5865
Rang H:44 11.6800 11.4200 7.1300 0.5225 0.6249 0.5626
Rang H:48 12.1700 10.7500 6.6400 0.5493 0.6519 0.5891
Rang Q:40 Rang H:12 11.6800 11.3200 7.1300 0.5269 0.6266 0.5658
Rang H:16 11.7000 11.2200 7.1100 0.5339 0.6268 0.5697
Rang H:20 12.1500 11.0000 6.6600 0.5466 0.6499 0.5864
Rang H:24 11.9700 10.9000 6.8400 0.5419 0.6386 0.5794
Rang H:28 11.6900 11.0900 7.1200 0.5308 0.6263 0.5684
Rang H:32 11.8900 10.9000 6.9200 0.5389 0.6370 0.5773
Rang H:36 12.2400 10.7100 6.5700 0.5492 0.6551 0.5908
Rang H:40 11.8800 11.1100 6.9300 0.5386 0.6361 0.5764
Rang H:44 11.7200 11.3200 7.0900 0.5288 0.6291 0.5679
Rang H:48 11.7200 11.2500 7.0900 0.5280 0.6270 0.5669
Rang Q:44 Rang H:12 11.6600 11.4700 7.1500 0.5285 0.6231 0.5643
Rang H:16 12.2600 10.8300 6.5500 0.5508 0.6554 0.5915
Rang H:20 11.6400 11.0500 7.1700 0.5309 0.6185 0.5645
Rang H:24 11.8700 11.0700 6.9400 0.5377 0.6351 0.5754
Rang H:28 11.5900 11.1200 7.2200 0.5255 0.6189 0.5625
Rang H:32 11.7700 10.9800 7.0400 0.5362 0.6280 0.5715
Rang H:36 11.6800 11.0500 7.1300 0.5312 0.6239 0.5674
Rang H:40 11.7000 11.0700 7.1100 0.5268 0.6226 0.5643
Rang H:44 11.5500 11.2400 7.2600 0.5232 0.6152 0.5586
Rang H:48 11.2400 11.4400 7.5700 0.5081 0.6039 0.5453
Rang Q:48 Rang H:12 11.9800 10.7300 6.8300 0.5500 0.6417 0.5849
Rang H:16 11.6500 11.2400 7.1600 0.5242 0.6212 0.5615
Rang H:20 11.5800 11.2500 7.2300 0.5228 0.6187 0.5602
Rang H:24 11.3000 11.6700 7.5100 0.5034 0.6035 0.5428
Rang H:28 11.7800 10.9300 7.0300 0.5326 0.6292 0.5712
Rang H:32 11.7200 11.1100 7.0900 0.5271 0.6260 0.5655
Rang H:36 11.2300 11.5200 7.5800 0.5034 0.5981 0.5407
Rang H:40 11.7300 10.8500 7.0800 0.5314 0.6249 0.5684
Rang H:44 11.2300 11.3800 7.5800 0.5098 0.6021 0.5452
Rang H:48 11.1100 11.6600 7.7000 0.4993 0.5913 0.5351
3 seconds results True Positives False Positives False Negatives Precision Recall F measure
Rang Q:12 Rang H:12 14.1200 9.5700 4.6900 0.6178 0.7543 0.6714
Rang H:16 14.2700 9.2800 4.5400 0.6282 0.7621 0.6807
Rang H:20 14.3400 8.9600 4.4700 0.6392 0.7659 0.6887
Rang H:24 14.2600 9.2500 4.5500 0.6284 0.7614 0.6805
Rang H:28 14.4000 8.9500 4.4100 0.6406 0.7692 0.6902
Rang H:32 14.3800 9.2400 4.4300 0.6338 0.7671 0.6854
Rang H:36 14.3000 9.1200 4.5100 0.6321 0.7642 0.6838
Rang H:40 14.3800 9.2400 4.4300 0.6328 0.7687 0.6859
Rang H:44 14.5000 9.0600 4.3100 0.6381 0.7742 0.6914
Rang H:48 14.4500 9.0000 4.3600 0.6390 0.7729 0.6915
Rang Q:16 Rang H:12 14.4800 9.2500 4.3300 0.6366 0.7753 0.6900
Rang H:16 14.6000 8.7100 4.2100 0.6524 0.7801 0.7023
Rang H:20 14.8800 8.7000 3.9300 0.6587 0.7970 0.7126
Rang H:24 14.6800 8.8500 4.1300 0.6509 0.7867 0.7031
Rang H:28 14.6700 8.8400 4.1400 0.6479 0.7828 0.7006
Rang H:32 14.6200 8.9800 4.1900 0.6478 0.7828 0.7001
Rang H:36 14.4000 9.0800 4.4100 0.6401 0.7701 0.6904
Rang H:40 14.4300 9.1200 4.3800 0.6367 0.7717 0.6895
Rang H:44 14.4800 9.0400 4.3300 0.6426 0.7745 0.6940
Rang H:48 14.6100 8.7300 4.2000 0.6528 0.7818 0.7028
Rang Q:20 Rang H:12 14.8400 8.8900 3.9700 0.6496 0.7948 0.7064
Rang H:16 14.8900 8.6200 3.9200 0.6596 0.7958 0.7127
Rang H:20 14.8700 8.4900 3.9400 0.6626 0.7941 0.7141
Rang H:24 14.8600 8.6000 3.9500 0.6614 0.7930 0.7125
Rang H:28 14.7700 8.5400 4.0400 0.6591 0.7915 0.7114
Rang H:32 14.6600 8.8400 4.1500 0.6495 0.7857 0.7029
Rang H:36 14.7800 8.5300 4.0300 0.6597 0.7920 0.7119
Rang H:40 14.9700 8.3000 3.8400 0.6685 0.8023 0.7211
Rang H:44 14.6500 8.8100 4.1600 0.6516 0.7845 0.7031
Rang H:48 14.8800 8.5400 3.9300 0.6633 0.7960 0.7150
Rang Q:24 Rang H:12 14.7500 8.7800 4.0600 0.6515 0.7870 0.7049
Rang H:16 15.0700 8.1500 3.7400 0.6729 0.8046 0.7246
Rang H:20 14.8900 8.6100 3.9200 0.6579 0.7963 0.7124
Rang H:24 14.9600 8.3500 3.8500 0.6664 0.7991 0.7183
Rang H:28 15.0500 8.3200 3.7600 0.6714 0.8049 0.7238
Rang H:32 15.2200 8.2200 3.5900 0.6740 0.8140 0.7296
Rang H:36 14.9500 8.2700 3.8600 0.6699 0.8000 0.7211
Rang H:40 15.1100 8.1900 3.7000 0.6723 0.8062 0.7250
Rang H:44 14.9300 8.2400 3.8800 0.6675 0.7966 0.7181
Rang H:48 15.1800 7.9900 3.6300 0.6820 0.8097 0.7315
Rang Q:28 Rang H:12 15.1000 8.1500 3.7100 0.6717 0.8064 0.7245
Rang H:16 14.9600 8.4800 3.8500 0.6632 0.7973 0.7154
Rang H:20 14.9700 8.2200 3.8400 0.6668 0.7984 0.7184
Rang H:24 15.0700 8.0100 3.7400 0.6771 0.8042 0.7271
Rang H:28 15.1000 8.1000 3.7100 0.6729 0.8037 0.7239
Rang H:32 15.1200 8.2700 3.6900 0.6679 0.8064 0.7221
Rang H:36 15.2000 8.1200 3.6100 0.6746 0.8113 0.7281
Rang H:40 14.9900 8.1200 3.8200 0.6741 0.8008 0.7235
Rang H:44 15.0000 7.9200 3.8100 0.6731 0.7991 0.7233
Rang H:48 15.1200 8.2600 3.6900 0.6718 0.8081 0.7253
Rang Q:32 Rang H:12 15.0300 8.3100 3.7800 0.6672 0.8004 0.7196
Rang H:16 15.2000 8.1400 3.6100 0.6733 0.8115 0.7277
Rang H:20 15.1200 8.0800 3.6900 0.6769 0.8088 0.7284
Rang H:24 15.1400 8.4200 3.6700 0.6639 0.8069 0.7199
Rang H:28 15.3400 8.1500 3.4700 0.6750 0.8189 0.7316
Rang H:32 15.1100 8.0000 3.7000 0.6713 0.8063 0.7249
Rang H:36 14.8100 8.2900 4.0000 0.6631 0.7913 0.7127
Rang H:40 15.2400 7.9000 3.5700 0.6816 0.8114 0.7320
Rang H:44 14.9700 8.0900 3.8400 0.6701 0.7986 0.7199
Rang H:48 14.9300 7.9300 3.8800 0.6740 0.7952 0.7210
Rang Q:36 Rang H:12 14.8700 8.3300 3.9400 0.6635 0.7925 0.7137
Rang H:16 15.0900 7.7100 3.7200 0.6828 0.8046 0.7304
Rang H:20 14.8600 8.2100 3.9500 0.6661 0.7938 0.7160
Rang H:24 14.7600 8.3000 4.0500 0.6614 0.7881 0.7107
Rang H:28 14.7800 8.1300 4.0300 0.6609 0.7872 0.7107
Rang H:32 14.8400 8.2500 3.9700 0.6625 0.7898 0.7124
Rang H:36 14.9100 8.0400 3.9000 0.6703 0.7968 0.7197
Rang H:40 14.8900 8.2200 3.9200 0.6655 0.7950 0.7161
Rang H:44 14.7700 8.3300 4.0400 0.6617 0.7896 0.7121
Rang H:48 15.0800 7.8400 3.7300 0.6764 0.8057 0.7270
Rang Q:40 Rang H:12 14.8200 8.1800 3.9900 0.6666 0.7919 0.7161
Rang H:16 14.8800 8.0400 3.9300 0.6702 0.7919 0.7176
Rang H:20 14.9000 8.2500 3.9100 0.6646 0.7944 0.7152
Rang H:24 14.9200 7.9500 3.8900 0.6734 0.7951 0.7209
Rang H:28 14.8300 7.9500 3.9800 0.6670 0.7899 0.7159
Rang H:32 14.7200 8.0700 4.0900 0.6651 0.7863 0.7127
Rang H:36 14.8800 8.0700 3.9300 0.6635 0.7943 0.7152
Rang H:40 14.8700 8.1200 3.9400 0.6688 0.7934 0.7176
Rang H:44 14.8300 8.2100 3.9800 0.6644 0.7922 0.7147
Rang H:48 14.9700 8.0000 3.8400 0.6739 0.7992 0.7235
Rang Q:44 Rang H:12 14.9700 8.1600 3.8400 0.6749 0.7987 0.7225
Rang H:16 15.0600 8.0300 3.7500 0.6722 0.8018 0.7231
Rang H:20 14.4600 8.2300 4.3500 0.6593 0.7700 0.7022
Rang H:24 15.0300 7.9100 3.7800 0.6794 0.8047 0.7283
Rang H:28 14.8000 7.9100 4.0100 0.6691 0.7893 0.7169
Rang H:32 14.7800 7.9700 4.0300 0.6719 0.7889 0.7174
Rang H:36 14.7500 7.9800 4.0600 0.6665 0.7861 0.7136
Rang H:40 14.6500 8.1200 4.1600 0.6598 0.7802 0.7073
Rang H:44 14.7000 8.0900 4.1100 0.6660 0.7834 0.7115
Rang H:48 14.6500 8.0300 4.1600 0.6640 0.7841 0.7111
Rang Q:48 Rang H:12 14.8800 7.8300 3.9300 0.6770 0.7934 0.7219
Rang H:16 14.8200 8.0700 3.9900 0.6663 0.7921 0.7152
Rang H:20 14.8700 7.9600 3.9400 0.6723 0.7937 0.7199
Rang H:24 14.4500 8.5200 4.3600 0.6457 0.7709 0.6952
Rang H:28 14.6400 8.0700 4.1700 0.6605 0.7827 0.7096
Rang H:32 14.7000 8.1300 4.1100 0.6606 0.7859 0.7097
Rang H:36 14.3900 8.3600 4.4200 0.6469 0.7668 0.6943
Rang H:40 14.7000 7.8800 4.1100 0.6650 0.7811 0.7112
Rang H:44 14.7300 7.8800 4.0800 0.6698 0.7879 0.7152
Rang H:48 14.5000 8.2700 4.3100 0.6518 0.7716 0.6990

Oracle ranks

In this condition, we only keep the ranks leading to the highest F measure.

In that sense, it's an optimistic upper bound on metrics.

In [7]:
hide.printmd("**A 0.5 secondes:**")
best_chr_zero_five = hide.best_f_one_score_rank(zero_five_eight)
hide.printmd("**A 3 secondes:**")
best_chr_three = hide.best_f_one_score_rank(three_eight)

A 0.5 secondes:

True Positives False Positives False Negatives Precision Recall F measure
Maximizing the f measure on each song: 14.93 7.67 3.88 0.6847 0.7999 0.7303

A 3 secondes:

True Positives False Positives False Negatives Precision Recall F measure
Maximizing the f measure on each song: 17.07 5.04 1.74 0.7948 0.9124 0.8414

Below is presented the distribution of the optimal ranks in the "oracle ranks" condition, i.e. the distribution of the ranks for $H$ and $Q$ which result in the highest F measure for the different songs.

In [8]:
hide.plot_3d_ranks_study(zero_five_eight, ranks_rhythm, ranks_pattern)

Below is shown the distribution histogram of the F measure obtained with the oracle ranks.

In [9]:
hide.plot_f_mes_histogram(zero_five_eight)

Mixed kernel

This kernel is a trade-off between local and "longer" term similarities.

Concretely, it is a sum of both previous kernels. It is composed of 0 in its diagonal, 2 in the 8 bands surrounding the diagonal, and 1 elsewhere.

It looks like:

(or, in a matrix form: $\left[ \begin{matrix} 0 & 2 & 2 & 2& 2 & 1 & 1 & 1\\ 2 & 0 & 2 & 2 & 2& 2 & 1 & 1\\ 2&2 & 0 & 2 & 2 & 2& 2 & 1\\ 2&2&2 & 0 & 2 & 2 & 2& 2\\ 2 & 2 & 2& 2 & 0 & 2&2&2\\ 1 & 2 & 2 & 2& 2 & 0 & 2&2\\ 1 & 1 & 2 & 2 & 2& 2 & 0 & 2\\ 1 & 1 & 1& 2 & 2 & 2& 2 & 0\\ \end{matrix} \right]$ (of size 8 here)).

Mathematically, for a segment ($b_1, b_2$), the associated cost will be $c_{b_1,b_2} = \frac{1}{b_2 - b_1 + 1}(\sum_{i,j = 0, i \ne j}^{n - 1} a_{i + b_1, j + b_1} + \sum_{i,j = 0, 1 \leq |i - j| \leq 4}^{n - 1} a_{i + b_1, j + b_1})$.

It's called mixed kernel as it mixes both previous paradigms.

Fixed ranks

Below are segmentation results with different ranks values, but each time fixed over the entire RWC Pop dataset.

Results are computed with tolerance of respectively 0.5 seconds and 3 seconds.

In [10]:
annotations_type = "MIREX10"
ranks_rhythm = [12,16,20,24,28,32,36,40,44,48]
ranks_pattern = [12,16,20,24,28,32,36,40,44,48]
zero_five_mixed, three_mixed = hide.compute_ranks_RWC(ranks_rhythm,ranks_pattern, W = "chromas", annotations_type = annotations_type,
                                                  subdivision=96, penalty_weight = 1,penalty_func = "modulo8", convolution_type = "mixed")
0.5 seconds results True Positives False Positives False Negatives Precision Recall F measure
Rang Q:12 Rang H:12 9.4900 10.2300 9.3200 0.4894 0.5109 0.4945
Rang H:16 10.1200 9.5800 8.6900 0.5195 0.5428 0.5251
Rang H:20 10.3100 9.2500 8.5000 0.5339 0.5516 0.5369
Rang H:24 10.3600 9.2300 8.4500 0.5388 0.5539 0.5407
Rang H:28 10.5000 9.0400 8.3100 0.5474 0.5620 0.5486
Rang H:32 9.9300 9.7600 8.8800 0.5101 0.5329 0.5160
Rang H:36 10.2100 9.3400 8.6000 0.5313 0.5474 0.5334
Rang H:40 10.2900 9.2400 8.5200 0.5345 0.5510 0.5370
Rang H:44 10.3500 9.2600 8.4600 0.5367 0.5536 0.5393
Rang H:48 10.5600 9.0100 8.2500 0.5490 0.5640 0.5507
Rang Q:16 Rang H:12 10.1300 9.7700 8.6800 0.5188 0.5453 0.5261
Rang H:16 10.6200 9.0700 8.1900 0.5512 0.5732 0.5563
Rang H:20 10.7000 8.9100 8.1100 0.5544 0.5740 0.5581
Rang H:24 10.7500 8.8000 8.0600 0.5609 0.5778 0.5634
Rang H:28 10.8700 8.8000 7.9400 0.5648 0.5840 0.5684
Rang H:32 10.5900 9.2400 8.2200 0.5450 0.5709 0.5521
Rang H:36 10.6300 8.9800 8.1800 0.5503 0.5695 0.5541
Rang H:40 10.6300 8.9300 8.1800 0.5529 0.5721 0.5567
Rang H:44 10.8200 8.7600 7.9900 0.5625 0.5784 0.5648
Rang H:48 10.8400 8.8500 7.9700 0.5607 0.5800 0.5644
Rang Q:20 Rang H:12 11.0600 8.8000 7.7500 0.5699 0.5939 0.5764
Rang H:16 10.8300 8.7400 7.9800 0.5654 0.5809 0.5673
Rang H:20 11.0400 8.6700 7.7700 0.5694 0.5917 0.5743
Rang H:24 11.2800 8.4300 7.5300 0.5835 0.6049 0.5879
Rang H:28 11.2100 8.5300 7.6000 0.5780 0.6013 0.5835
Rang H:32 10.7400 9.0600 8.0700 0.5550 0.5782 0.5612
Rang H:36 10.9000 8.7900 7.9100 0.5678 0.5871 0.5717
Rang H:40 11.2700 8.5500 7.5400 0.5828 0.6077 0.5891
Rang H:44 10.9500 8.7700 7.8600 0.5658 0.5883 0.5712
Rang H:48 11.1700 8.6000 7.6400 0.5760 0.5990 0.5816
Rang Q:24 Rang H:12 11.0200 8.9500 7.7900 0.5638 0.5946 0.5737
Rang H:16 10.9800 8.5700 7.8300 0.5731 0.5905 0.5761
Rang H:20 10.7800 8.8700 8.0300 0.5609 0.5819 0.5655
Rang H:24 11.0700 8.8100 7.7400 0.5704 0.5968 0.5776
Rang H:28 11.3500 8.3400 7.4600 0.5890 0.6089 0.5928
Rang H:32 11.3300 8.5100 7.4800 0.5809 0.6069 0.5884
Rang H:36 11.2400 8.5100 7.5700 0.5789 0.6031 0.5852
Rang H:40 11.0300 8.7600 7.7800 0.5663 0.5931 0.5733
Rang H:44 11.1700 8.5500 7.6400 0.5758 0.6007 0.5822
Rang H:48 11.5100 8.0800 7.3000 0.6013 0.6178 0.6036
Rang Q:28 Rang H:12 10.8500 8.9900 7.9600 0.5567 0.5848 0.5651
Rang H:16 10.8800 8.9200 7.9300 0.5581 0.5814 0.5639
Rang H:20 11.1900 8.5100 7.6200 0.5798 0.6001 0.5844
Rang H:24 11.0300 8.6100 7.7800 0.5726 0.5910 0.5767
Rang H:28 11.2600 8.6300 7.5500 0.5787 0.6041 0.5852
Rang H:32 11.1300 8.7600 7.6800 0.5705 0.5964 0.5778
Rang H:36 11.4400 8.2700 7.3700 0.5899 0.6143 0.5961
Rang H:40 11.1900 8.4500 7.6200 0.5800 0.6009 0.5842
Rang H:44 11.2000 8.3200 7.6100 0.5820 0.6011 0.5863
Rang H:48 11.2300 8.6200 7.5800 0.5752 0.6034 0.5834
Rang Q:32 Rang H:12 10.9900 8.9100 7.8200 0.5653 0.5899 0.5720
Rang H:16 10.9400 8.9800 7.8700 0.5590 0.5878 0.5681
Rang H:20 11.0200 8.7700 7.7900 0.5655 0.5883 0.5712
Rang H:24 11.3400 8.6400 7.4700 0.5758 0.6065 0.5853
Rang H:28 10.9100 8.9400 7.9000 0.5596 0.5854 0.5668
Rang H:32 11.1300 8.3700 7.6800 0.5802 0.5958 0.5822
Rang H:36 11.1100 8.5400 7.7000 0.5757 0.5971 0.5800
Rang H:40 11.1600 8.5900 7.6500 0.5717 0.5956 0.5770
Rang H:44 11.0000 8.6100 7.8100 0.5695 0.5905 0.5740
Rang H:48 11.1700 8.1900 7.6400 0.5871 0.5997 0.5871
Rang Q:36 Rang H:12 11.2700 8.5600 7.5400 0.5787 0.6053 0.5858
Rang H:16 11.1000 8.5300 7.7100 0.5763 0.5951 0.5799
Rang H:20 11.4100 8.3500 7.4000 0.5877 0.6122 0.5937
Rang H:24 11.0800 8.4000 7.7300 0.5779 0.5928 0.5796
Rang H:28 11.1700 8.2900 7.6400 0.5851 0.5990 0.5861
Rang H:32 10.9100 8.5900 7.9000 0.5676 0.5839 0.5694
Rang H:36 11.5600 8.2300 7.2500 0.5940 0.6175 0.6002
Rang H:40 11.3600 8.2500 7.4500 0.5876 0.6088 0.5921
Rang H:44 11.0400 8.4100 7.7700 0.5746 0.5914 0.5773
Rang H:48 11.1100 8.4600 7.7000 0.5768 0.5966 0.5808
Rang Q:40 Rang H:12 10.7600 9.0300 8.0500 0.5534 0.5782 0.5599
Rang H:16 11.0500 8.6500 7.7600 0.5757 0.5942 0.5784
Rang H:20 11.0200 8.6900 7.7900 0.5719 0.5909 0.5751
Rang H:24 11.0700 8.3600 7.7400 0.5812 0.5928 0.5809
Rang H:28 10.7300 8.7300 8.0800 0.5612 0.5760 0.5630
Rang H:32 11.4300 8.0900 7.3800 0.5958 0.6109 0.5969
Rang H:36 11.2500 8.3000 7.5600 0.5849 0.6025 0.5876
Rang H:40 11.2100 8.3000 7.6000 0.5853 0.6006 0.5864
Rang H:44 11.0800 8.4100 7.7300 0.5772 0.5933 0.5795
Rang H:48 11.0400 8.5100 7.7700 0.5737 0.5914 0.5766
Rang Q:44 Rang H:12 11.0000 8.7500 7.8100 0.5699 0.5901 0.5739
Rang H:16 11.1100 8.6200 7.7000 0.5740 0.5940 0.5772
Rang H:20 11.0800 8.4400 7.7300 0.5776 0.5914 0.5782
Rang H:24 11.3800 8.2100 7.4300 0.5926 0.6090 0.5948
Rang H:28 10.9500 8.5100 7.8600 0.5679 0.5830 0.5694
Rang H:32 10.9500 8.4300 7.8600 0.5705 0.5836 0.5710
Rang H:36 11.1000 8.3600 7.7100 0.5771 0.5919 0.5784
Rang H:40 10.8400 8.4600 7.9700 0.5667 0.5771 0.5659
Rang H:44 10.7100 8.7100 8.1000 0.5590 0.5728 0.5596
Rang H:48 10.6800 8.7100 8.1300 0.5595 0.5741 0.5601
Rang Q:48 Rang H:12 11.1000 8.5600 7.7100 0.5768 0.5971 0.5805
Rang H:16 11.1400 8.4400 7.6700 0.5769 0.5942 0.5790
Rang H:20 10.5100 8.9700 8.3000 0.5460 0.5617 0.5479
Rang H:24 10.7200 8.7400 8.0900 0.5563 0.5746 0.5593
Rang H:28 10.7100 8.6400 8.1000 0.5593 0.5748 0.5610
Rang H:32 11.0400 8.3000 7.7700 0.5802 0.5890 0.5783
Rang H:36 10.3900 9.0500 8.4200 0.5381 0.5558 0.5411
Rang H:40 10.5800 8.7600 8.2300 0.5544 0.5655 0.5539
Rang H:44 10.4200 8.9200 8.3900 0.5445 0.5561 0.5446
Rang H:48 10.4800 8.6800 8.3300 0.5518 0.5576 0.5491
3 seconds results True Positives False Positives False Negatives Precision Recall F measure
Rang Q:12 Rang H:12 13.3400 6.3800 5.4700 0.6885 0.7136 0.6939
Rang H:16 13.3800 6.3200 5.4300 0.6901 0.7150 0.6952
Rang H:20 13.3600 6.2000 5.4500 0.6954 0.7155 0.6985
Rang H:24 13.4200 6.1700 5.3900 0.6980 0.7172 0.7008
Rang H:28 13.6700 5.8700 5.1400 0.7148 0.7303 0.7152
Rang H:32 13.4900 6.2000 5.3200 0.6970 0.7224 0.7027
Rang H:36 13.5000 6.0500 5.3100 0.7048 0.7228 0.7064
Rang H:40 13.4700 6.0600 5.3400 0.7041 0.7227 0.7065
Rang H:44 13.5400 6.0700 5.2700 0.7038 0.7253 0.7076
Rang H:48 13.6300 5.9400 5.1800 0.7125 0.7310 0.7148
Rang Q:16 Rang H:12 13.5800 6.3200 5.2300 0.6922 0.7253 0.7012
Rang H:16 13.5300 6.1600 5.2800 0.7022 0.7265 0.7072
Rang H:20 13.7400 5.8700 5.0700 0.7123 0.7346 0.7162
Rang H:24 13.6600 5.8900 5.1500 0.7121 0.7313 0.7146
Rang H:28 13.9700 5.7000 4.8400 0.7244 0.7481 0.7292
Rang H:32 13.9700 5.8600 4.8400 0.7185 0.7488 0.7262
Rang H:36 13.6600 5.9500 5.1500 0.7093 0.7315 0.7134
Rang H:40 13.6700 5.8900 5.1400 0.7109 0.7325 0.7147
Rang H:44 13.7900 5.7900 5.0200 0.7173 0.7373 0.7204
Rang H:48 13.8500 5.8400 4.9600 0.7166 0.7411 0.7216
Rang Q:20 Rang H:12 13.8900 5.9700 4.9200 0.7110 0.7423 0.7200
Rang H:16 13.7800 5.7900 5.0300 0.7177 0.7362 0.7201
Rang H:20 13.7300 5.9800 5.0800 0.7082 0.7334 0.7135
Rang H:24 13.9000 5.8100 4.9100 0.7190 0.7433 0.7236
Rang H:28 14.0500 5.6900 4.7600 0.7234 0.7519 0.7304
Rang H:32 13.8900 5.9100 4.9200 0.7111 0.7414 0.7197
Rang H:36 13.7600 5.9300 5.0500 0.7133 0.7384 0.7189
Rang H:40 13.8300 5.9900 4.9800 0.7124 0.7419 0.7199
Rang H:44 13.6300 6.0900 5.1800 0.7017 0.7303 0.7089
Rang H:48 13.9700 5.8000 4.8400 0.7199 0.7485 0.7272
Rang Q:24 Rang H:12 13.9600 6.0100 4.8500 0.7087 0.7463 0.7208
Rang H:16 13.8800 5.6700 4.9300 0.7229 0.7439 0.7268
Rang H:20 13.8200 5.8300 4.9900 0.7153 0.7400 0.7207
Rang H:24 13.9600 5.9200 4.8500 0.7162 0.7472 0.7246
Rang H:28 14.0400 5.6500 4.7700 0.7265 0.7506 0.7313
Rang H:32 14.1800 5.6600 4.6300 0.7241 0.7572 0.7340
Rang H:36 14.1100 5.6400 4.7000 0.7259 0.7563 0.7342
Rang H:40 13.7500 6.0400 5.0600 0.7076 0.7366 0.7147
Rang H:44 14.0100 5.7100 4.8000 0.7209 0.7487 0.7277
Rang H:48 14.1900 5.4000 4.6200 0.7362 0.7574 0.7398
Rang Q:28 Rang H:12 14.0700 5.7700 4.7400 0.7209 0.7536 0.7301
Rang H:16 13.8800 5.9200 4.9300 0.7138 0.7417 0.7208
Rang H:20 13.9600 5.7400 4.8500 0.7194 0.7435 0.7250
Rang H:24 14.1600 5.4800 4.6500 0.7309 0.7561 0.7372
Rang H:28 14.0200 5.8700 4.7900 0.7177 0.7483 0.7258
Rang H:32 13.9700 5.9200 4.8400 0.7135 0.7449 0.7224
Rang H:36 14.0400 5.6700 4.7700 0.7230 0.7508 0.7299
Rang H:40 13.9900 5.6500 4.8200 0.7256 0.7489 0.7299
Rang H:44 13.8600 5.6600 4.9500 0.7192 0.7407 0.7238
Rang H:48 14.0600 5.7900 4.7500 0.7199 0.7524 0.7292
Rang Q:32 Rang H:12 14.0300 5.8700 4.7800 0.7160 0.7468 0.7246
Rang H:16 14.1300 5.7900 4.6800 0.7175 0.7530 0.7286
Rang H:20 14.1400 5.6500 4.6700 0.7256 0.7541 0.7327
Rang H:24 14.2200 5.7600 4.5900 0.7197 0.7577 0.7317
Rang H:28 14.2700 5.5800 4.5400 0.7293 0.7593 0.7369
Rang H:32 13.8400 5.6600 4.9700 0.7205 0.7375 0.7219
Rang H:36 13.9100 5.7400 4.9000 0.7196 0.7432 0.7236
Rang H:40 14.1300 5.6200 4.6800 0.7267 0.7536 0.7322
Rang H:44 13.8300 5.7800 4.9800 0.7173 0.7396 0.7211
Rang H:48 13.8600 5.5000 4.9500 0.7289 0.7403 0.7270
Rang Q:36 Rang H:12 13.9300 5.9000 4.8800 0.7155 0.7437 0.7226
Rang H:16 13.7700 5.8600 5.0400 0.7124 0.7349 0.7167
Rang H:20 13.9300 5.8300 4.8800 0.7172 0.7437 0.7231
Rang H:24 13.7900 5.6900 5.0200 0.7190 0.7363 0.7209
Rang H:28 13.9300 5.5300 4.8800 0.7262 0.7433 0.7274
Rang H:32 13.9000 5.6000 4.9100 0.7250 0.7424 0.7259
Rang H:36 14.2600 5.5300 4.5500 0.7310 0.7607 0.7391
Rang H:40 13.9000 5.7100 4.9100 0.7179 0.7425 0.7231
Rang H:44 13.8300 5.6200 4.9800 0.7225 0.7401 0.7245
Rang H:48 13.7800 5.7900 5.0300 0.7148 0.7376 0.7190
Rang Q:40 Rang H:12 13.7100 6.0800 5.1000 0.7044 0.7341 0.7123
Rang H:16 13.8600 5.8400 4.9500 0.7191 0.7412 0.7223
Rang H:20 13.8100 5.9000 5.0000 0.7142 0.7391 0.7189
Rang H:24 13.9100 5.5200 4.9000 0.7303 0.7411 0.7282
Rang H:28 13.8000 5.6600 5.0100 0.7194 0.7354 0.7204
Rang H:32 13.8500 5.6700 4.9600 0.7236 0.7399 0.7239
Rang H:36 13.9000 5.6500 4.9100 0.7226 0.7423 0.7250
Rang H:40 13.9300 5.5800 4.8800 0.7256 0.7427 0.7264
Rang H:44 13.7600 5.7300 5.0500 0.7183 0.7355 0.7200
Rang H:48 13.8300 5.7200 4.9800 0.7207 0.7391 0.7230
Rang Q:44 Rang H:12 13.8900 5.8600 4.9200 0.7177 0.7419 0.7227
Rang H:16 13.7400 5.9900 5.0700 0.7099 0.7319 0.7130
Rang H:20 13.6800 5.8400 5.1300 0.7165 0.7310 0.7162
Rang H:24 14.0000 5.5900 4.8100 0.7292 0.7486 0.7317
Rang H:28 13.8100 5.6500 5.0000 0.7208 0.7379 0.7222
Rang H:32 13.8300 5.5500 4.9800 0.7251 0.7391 0.7250
Rang H:36 13.7500 5.7100 5.0600 0.7186 0.7346 0.7191
Rang H:40 13.5000 5.8000 5.3100 0.7083 0.7200 0.7070
Rang H:44 13.6500 5.7700 5.1600 0.7155 0.7288 0.7147
Rang H:48 13.7200 5.6700 5.0900 0.7226 0.7342 0.7205
Rang Q:48 Rang H:12 13.8200 5.8400 4.9900 0.7159 0.7383 0.7195
Rang H:16 13.8500 5.7300 4.9600 0.7193 0.7410 0.7223
Rang H:20 13.6500 5.8300 5.1600 0.7139 0.7292 0.7144
Rang H:24 13.6100 5.8500 5.2000 0.7089 0.7269 0.7104
Rang H:28 13.4800 5.8700 5.3300 0.7077 0.7218 0.7076
Rang H:32 13.7700 5.5700 5.0400 0.7249 0.7360 0.7226
Rang H:36 13.5300 5.9100 5.2800 0.7039 0.7216 0.7055
Rang H:40 13.6400 5.7000 5.1700 0.7157 0.7256 0.7131
Rang H:44 13.5300 5.8100 5.2800 0.7104 0.7232 0.7096
Rang H:48 13.5900 5.5700 5.2200 0.7216 0.7274 0.7174

Oracle ranks

In this condition, we only keep the ranks leading to the highest F measure.

In that sense, it's an optimistic upper bound on metrics.

In [11]:
hide.printmd("**A 0.5 secondes:**")
best_chr_zero_five = hide.best_f_one_score_rank(zero_five_mixed)
hide.printmd("**A 3 secondes:**")
best_chr_three = hide.best_f_one_score_rank(three_mixed)

A 0.5 secondes:

True Positives False Positives False Negatives Precision Recall F measure
Maximizing the f measure on each song: 14.13 5.58 4.68 0.7311 0.7581 0.7372

A 3 secondes:

True Positives False Positives False Negatives Precision Recall F measure
Maximizing the f measure on each song: 16.37 3.24 2.44 0.846 0.874 0.8538

Below is presented the distribution of the optimal ranks in the "oracle ranks" condition, i.e. the distribution of the ranks for $H$ and $Q$ which result in the highest F measure for the different songs.

In [12]:
hide.plot_3d_ranks_study(zero_five_mixed, ranks_rhythm, ranks_pattern)

Below is shown the distribution histogram of the F measure obtained with the oracle ranks.

In [13]:
hide.plot_f_mes_histogram(zero_five_mixed)

Conclusion

In conclusion, we considered that the "8 bands kernel" was a reasonnable trade-off between:

  • An increase of scores compared to the "full kernel",
  • Its simplicity to be explained without all this evaluation context in the paper (especially compared to the "mixed kernel", which need to first introduce both other kernels).

In that sense, we used that kernel in our final experiments, and as the default kernel in the paper.

In future work, if this segmentation technique is still used, it might be interesting to focus on the mixed kernel instead, which seem more promising (notably on its distribution of best ranks).